package ysq.xyg.web.model.po;

import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.NoArgsConstructor;

import lombok.Data;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 业务模块-活动订单实体类
 *
 * @author shengQiang yu
 * @date 2019-5-11 10:02:08
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_web_order")
public class WebOrder implements Serializable{

	/**
     * 主键
     */ 
	@Id
	private String id;
	
	/**
     * 活动id
     */ 
	@Column(name = "sign_id")
	private String signId;
	
	/**
     * 会员id
     */ 
	@Column(name = "member_id")
	private String memberId;
	
	/**
     * 姓名
     */
	@Excel(name = "姓名",orderNum = "1")
	@Column(name = "name")
	private String name;
	
	/**
     * 出生日期
     */
	@Excel(name = "出生日期", format = "yyyy-MM-dd",orderNum = "2")
	@Column(name = "brithday")
	private Date brithday;
	
	/**
     * 性别：1、男，2、女
     */
	@Excel(name = "性别",replace = { "男_1", "女_2"},orderNum = "3")
	@Column(name = "sex")
	private String sex;
	
	/**
     * 民族
     */
	@Excel(name = "民族",orderNum = "4")
	@Column(name = "nation")
	private String nation;
	
	/**
     * 联系电话
     */
	@Excel(name = " 联系电话",orderNum = "5")
	@Column(name = "phone")
	private String phone;
	
	/**
     * 工作地址
     */
	@Excel(name = "工作地址",orderNum = "6")
	@Column(name = "work_address")
	private String workAddress;
	
	/**
     * 家庭地址
     */
	@Excel(name = "家庭地址",orderNum = "7")
	@Column(name = "home_address")
	private String homeAddress;
	
	/**
     * 身份证号
     */
	@Excel(name = "家庭地址",orderNum = "8")
	@Column(name = "id_card")
	private String idCard;
	
	/**
     * 身份证照片
     */ 
	@Column(name = "id_card_picture")
	private String idCardPicture;

	/**
	 * 政治面貌
	 */
	@Excel(name = "家庭地址",orderNum = "9")
	@Column(name = "political")
	private String political;
	/**
	 * 照片
	 */
	@Column(name = "head_image")
	private String headImage;
	/**
     * 用户类型：1、成人，2、儿童
     */ 
	@Column(name = "user_type")
	private String userType;
	
	/**
     * 学生年级：1、小学一年级
     */ 
	@Column(name = "student_grade")
	private String studentGrade;
	
	/**
     * 就读学校：1、学校一
     */ 
	@Column(name = "student_school")
	private String studentSchool;
	
	/**
     * 家长姓名
     */ 
	@Column(name = "parent_name")
	private String parentName;
	
	/**
     * 审核状态:1、待审核，2、审核通过,3、审核未通过
     */
	@Excel(name = "审核状态",replace = { "待审核_1", "审核通过_2", "审核未通过_2"},orderNum = "10")
	@Column(name = "status")
	private String status;
	/**
	 * 审核时间
	 */
	@Excel(name = "审核时间", format = "yyyy-MM-dd HH:mm:ss",orderNum = "11")
	@Column(name = "check_time")
	private Date checkTime;
	/**
	 * 审核备注
	 */
	@Excel(name = "审核备注",orderNum = "12")
	@Column(name = "check_remark")
	private String checkRemark;
	/**
     * 删除标注:1、正常，2、删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;
	
	/**
     * 创建时间
     */
	@Excel(name = "提交时间", format = "yyyy-MM-dd HH:mm:ss",orderNum = "9")
	@Column(name = "create_time")
	private Date createTime;
	
	/**
     * 创建人
     */ 
	@Column(name = "create_user")
	private String createUser;
	
	/**
     * 修改时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;
	
	/**
     * 修改人
     */ 
	@Column(name = "update_user")
	private String updateUser;


	/**
	 * 出生日期Str
	 */
	@Transient
	private String brithdayStr;

	public WebOrder(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}